﻿using System.ComponentModel.DataAnnotations;

namespace LERP.Web.Controllers.ViewModels.CustomerViewModels
{
    public class CreateThirdCustomerViveModel
    {
        /// <summary>
        /// 父级客户
        /// </summary> 
        [Display(Name = "父级客户")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual int ParentId { get; set; }
        /// <summary>
        /// 归属员工
        /// </summary> 
        [Display(Name = "归属员工")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual int UserId { get; set; }
        /// <summary>
        /// 客户名称
        /// </summary> 
        [Display(Name = "客户名称")]
        [StringLength(64, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual string Name { get; set; }
        /// <summary>
        /// 联系人名称
        /// </summary> 
        [Display(Name = "联系人名称")] 
        [StringLength(64, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Linkman { get; set; }

        /// <summary>
        /// 手机号
        /// </summary> 
        [Display(Name = "手机号")] 
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        [RegularExpression("1\\d{10}", ErrorMessage = "不是合法的{0}格式,正确格式：13560123123")]
        public virtual string Mobile { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary> 
        [Display(Name = "邮箱")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        [RegularExpression("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*", ErrorMessage = "不是合法的{0}格式,正确格式：username@qq.com")]
        public virtual string Email { get; set; }
        /// <summary>
        /// 传真
        /// </summary> 
        [Display(Name = "传真")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        [RegularExpression("\\d{3}-\\d{8}|\\d{4}-\\d{7}", ErrorMessage = "不是合法的{0}格式,正确格式：020-88888888")]
        public virtual string Fax { get; set; }
        /// <summary>
        ///备注
        /// </summary>  
        [Display(Name = "备注")]
        [StringLength(500, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Remark { get; set; }

        /// <summary>
        /// 省份
        /// </summary> 
        [Display(Name = "省份")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Province { get; set; }
        /// <summary>
        /// 地市
        /// </summary> 
        [Display(Name = "地市")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string City { get; set; }

        /// <summary>
        /// 地址
        /// </summary> 
        [Display(Name = "地址")]
        [StringLength(255, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Address { get; set; }

        /// <summary>
        /// 立方运费
        /// </summary>  
        [Display(Name = "立方运费")]
        [RegularExpression("^[1-9]\\d*[\\.]?\\d*|0\\.\\d*[1-9]\\d*$", ErrorMessage = "只能输入大于0的数字")] 
        public virtual decimal UnitFreight { get; set; }
        /// <summary>
        /// 单次运费
        /// </summary> 
        [Display(Name = "单次运费")]
        [RegularExpression("^[1-9]\\d*[\\.]?\\d*|0\\.\\d*[1-9]\\d*$", ErrorMessage = "只能输入大于0的数字")] 
        public virtual decimal OnceFreight { get; set; }

        /// <summary>
        /// 在途天数
        /// </summary>  
        [Display(Name = "在途天数")]
        [RegularExpression("^[1-9]\\d*$", ErrorMessage = "只能输入正整数")] 
        public virtual int Days { get; set; }
    }
}